package fct.mpc.snipehunter;


import android.app.ListActivity;
import android.os.Bundle;
import android.widget.SimpleAdapter;
import fct.mpc.utils.StatManager;

public class SnipeHunterStatsActivity extends ListActivity {

	private StatManager statsData;
	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.stats);

		statsData = new StatManager(this);
		statsData.open();

		statsData.loadStats();

		String[] fromColumns = StatManager.allColumns;
        int[] toViews = {R.id.stats_key};
		    
        
        SimpleAdapter adapter = new SimpleAdapter(this, 
													statsData.getStatMapping(), 
													android.R.layout.two_line_list_item,
													fromColumns, 
        											toViews 
        											);
		setListAdapter(adapter);
	}
	
	
	@Override
	protected void onResume() {
		statsData.open();
		super.onResume();
	}

	@Override
	protected void onPause() {
		statsData.close();
		super.onPause();
	}
}
